# 存储所点比萨的信息
pizza = {'crust': ' thick',
        'toppings': ['mushrooms', 'extra cheese'],
        }

# 概述所点的比萨
print("You ordered a " + pizza['crust'] + "-crust pizza " + 
        "with the following toppings:")

for topping in pizza['toppings']:
    print("\t" + topping)

favorite_languages= {
        'jen': ['ruby', 'python', 'java'],
        'jam': ['php', 'python', 'C'],
        'phil': ['php', 'html', 'c#'],
        'edward': ['go', 'php'],
        'wangxu': ['python'],
        }

for name, languages in favorite_languages.items():
    print(name.title(), end="")
    print(':')
    if len(languages) == 1:
        print('只有一种语言' + language)
    else:
        for language in languages:
            print(language)
    print("------------------------")

users = {
    'jam':{
        'first': 'albert',
        'last': 'am',
        'location': 'princetion'},
    'mcurie':{
        'first': 'marie',
        'last': 'curie',
        'location': 'paris'}
        }

for name, user_info in users.items():
    print('\nUsername:' + name)
    full_name = user_info['first'] + user_info['last']
    location = user_info['location']
    print("\tFull_name: " + full_name.title())
    print("\tLocation: " + location.title())

# 人
xiaoming = {'name': 'xiaoming', 'favorite_language': 'python', 'location':
        'shanghai'}
xiaofang = {'name': 'xiaofang', 'favorite_language': 'php', 'location':
        'sichuan'}
xiaohong = {'name': 'xiaohong', 'favorite_language': 'ruby', 'location':
        'guangzhou'}
xiaochen = {'name': 'xiaochen', 'favorite_language': 'go', 'location':
        'shenzhen'}
xiaogao = {'name': 'xiaogao', 'favorite_language': 'C', 'location': 'hunan'}
peoples = [xiaoming, xiaofang, xiaohong, xiaochen, xiaogao]
print(peoples)

for people in peoples:
    print("%s的基本信息是：" % people['name'].title())
    for key, value in people.items():
        print(key + ":" + value.upper())


# 宠物
xiaohua = {'姓名': 'xiaohua', '类型': 'cat', '主人名字': 'xiaohong'}
xiaoqiang = {'姓名': 'xiaoqiang', '类型': 'dog', '主人名字': 'xiaozhou'}
xiaoguai = {'姓名': 'xiaoguai', '类型': 'pig', '主人名字': 'xiaoli'}
pets = [xiaohua, xiaoqiang, xiaoguai]
print(pets)
for pet in pets:
    print("%s的基本信息是" % pet['姓名'])
    for key, value in pet.items():
        print(key + ":" + value)

# 喜欢的地方
xiaoqiang = ['huangshan', 'emeishang', 'hainandao', 'balidao']
xiaohua = ['tiankong', 'dahai', 'huayuan', 'wuding']
xiaochen = ['changcheng', 'dongtinghua', 'chaoshi', 'feijishang']
messages = {'小强': xiaoqiang, '小花': xiaohua, '小陈': xiaochen}
print(messages)
